home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Sun Solutions 1997 April to September
/
Sun Solutions CD - APR '97 - SEP '97 (704-3778-12 Rev. H)(Sun Microsystems, Inc.)(1997).iso
/
products
/
bin
/
httpd
/
Solaris_2
/
today
< prev
next >
Wrap
Text File
|
1995-12-09
|
1KB
|
57 lines
#!./perl
#
# This script will redirect the client to /channel/day or /channel/night
# depending on the time of day (according to the server).
#
#require "ctime.pl";
#
# Play with these variables to meet your needs
#
$day_path = "";
$night_path = "#night";
$start_day = 7; # Daytime starts at 7 am
$start_night = 19; # Nightime starts at 7 pm
#
# The code starts here
#
@day = split (' ', `/usr/bin/date` );
#print $day[2];
@today = split (' ', `/usr/bin/time` );
($hour,$min,$sec) = split(':',$today[3]);
if ($hour >= $start_night || $hour < $start_day) {
# Ok, we're in nightime
$redirpath = $night_path;
}
else {
# It's daytime
$redirpath = $day_path;
}
$file = "day$day[2].html";
print "Content-type: text/html\n\n";
print "<html><head>\n";
print "<title>Disney Channel Program Guide</title>\n";
print "</head>\n<body>\n";
open(DAY,"../docs/disney/tdc/program_guide/days/$file");
while (<DAY>) {
print STDOUT $_;
}
close(DAY);
#print "Location: http://snl.eng\n\n";